/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * Name       :电压持续越限指标
 */


var fieldLabel = new Array('指标名称','允许持续越限时间（分）','测量点类型','A类测点主要调压方式','指标下达单位','指标创建单位');

var fieldName=new Array('zbmc','yxcxyxsj','pointType','Altyfs','zbxddw','zbcjdw');

var centerpageSize=20;






var centerstore=new Ext.data.JsonStore({               
    //data: [
    //       ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17']
    //]
    url: "../../servlet/report/gridvoltagepoint",
    root: 'data',
    idProperty: 'id',
    totalProperty: 'count',
    fields: fieldName,
    autoLoad: true
});



var centercolumnModel = new Ext.grid.ColumnModel({
    columns: [
    new Ext.grid.RowNumberer({
        header : '序号',
        align: 'center', 
        width : 40
    }),
    {header: fieldLabel[0],width: 100, dataIndex: fieldName[0], align: 'center'},
    {header: fieldLabel[1],width: 100, dataIndex: fieldName[1], align: 'center'},
    {header: fieldLabel[2],width: 100, dataIndex: fieldName[2], align: 'center'},
    {header: fieldLabel[3],width: 100, dataIndex: fieldName[3], align: 'center'},
    {header: fieldLabel[4],width: 100, dataIndex: fieldName[2], align: 'center'},
    {header: fieldLabel[5],width: 100, dataIndex: fieldName[3], align: 'center'},
    ],
    defaultSortable: true
});

var centergrid=new Ext.grid.GridPanel({
    title: '电压持续越限指标',
    store: centerstore,
    colModel:centercolumnModel,
    enableColumnMove: false,
    viewConfig: {
        forceFit: true
    },
    
    loadMask: true,
    tbar: new Ext.Toolbar([
        {text: '新增', iconCls: 'icon-add', handler: 'addnew'},
            '-',
            {text: '修改', iconCls: 'icon-edit', handler: 'update'},
            '-',
            {text: '删除', iconCls: 'icon-delete', handler: 'remove'}
    ]),
    bbar: new Ext.PagingToolbar({
        pageSize: centerpageSize,
        store: centerstore,
        displayInfo: true,
        displayMsg: '显示记录：{0} - {1}   总记录：{2}',
        emptyMsg:  '目前没有信息'
    })
});
centerstore.load({
    params: {
        start: 0, 
        limit: centerpageSize
    }
})

function buildWindow(){
    var applicationUI = new Ext.Viewport({
        layout:'fit',
        items: [
        centergrid
        ]
    });
}
Ext.onReady(buildWindow); 
